//
//  LotteryExtension.m
//  WangLottery
//
//  Created by 黄修勇 on 12-4-23.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "LotteryExtension.h"

@implementation UIImage (Ex)

+(id)getImageByName:(NSString *)name{

    NSString *imagePath=[[NSBundle mainBundle]pathForResource:name ofType:nil];
    return [UIImage imageWithContentsOfFile:imagePath];
}

@end

@implementation UILabel(Ex)

+(id)creatBettingCellLabelWithFrame:(CGRect)frame{

    UILabel *label=[[UILabel alloc]initWithFrame:frame];
    label.backgroundColor=[UIColor clearColor];
    label.font=[UIFont systemFontOfSize:14.0f];
    return label;
}

+(id)creatBettingConinfoCellWithFrame:(CGRect)frame{

    UILabel *label=[[UILabel alloc]initWithFrame:frame];
    label.textColor=[UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.8f];
    label.font=[UIFont boldSystemFontOfSize:17.0f];
    label.backgroundColor=[UIColor clearColor];
    return label;
}

+(id)creatBettingConRedLabelWithFrame:(CGRect)frame{

    UILabel *label=[[UILabel alloc]initWithFrame:frame];
    label.textColor=[UIColor redColor];
    label.font=[UIFont boldSystemFontOfSize:15.0f];
    label.backgroundColor=[UIColor clearColor];
    return label;
}
-(void)reSetLabelFrame{

    [self sizeToFit];
    self.frame=CGRectMake(100.0f, 45.0f/2-self.frame.size.height/2, self.frame.size.width, self.frame.size.height);
}
@end

@implementation NSObject (Ex)

-(void)showAlertViewWithTitle:(NSString *)title msg:(NSString *)msg{

    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:title message:msg delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    [alert show];
    [alert release];
}

@end